<template>
  <base-dialog ref="dialog" title="查询收运单">
    <template #default="{ close }">
      <uni-forms ref="form" :model="form" label-width="150"
                 style="width: 100%;">
        <uni-forms-item label="机构类型" name="vehicleId">
          <base-picker v-model="form.mdcInstitutionType" :localdata="typeList"/>
        </uni-forms-item>
        <uni-forms-item label="机构简称" name="medicalInstitutionShortName">
          <uni-easyinput v-model="form.mdcInstitutionShortName" :input-border="false" placeholder="请输入"/>
        </uni-forms-item>
        <uni-forms-item label="收运单号" name="serialNo">
          <uni-easyinput v-model="form.serialNo" :input-border="false" placeholder="请输入"/>
        </uni-forms-item>
        <uni-forms-item label="状态" name="status">
          <base-picker v-model="form.status" :localdata="statusList"/>
        </uni-forms-item>

        <view class="btn-group">
          <!-- <button class="def-btn" @click="() => form = {}">重置</button>
          <button class="main-btn" @click="submit()">查询</button> -->
		  <view class="chongzhi flexmid" @click="() => form = {}">重置</view>
		  <view class="chaxun flexmid" @click="submit()">查询</view>
        </view>
      </uni-forms>
    </template>
  </base-dialog>
</template>

<script>

export default {
  data() {
    return {
      form: {},
      typeList: [],
      statusList: [
        {text: '待收运', value: 'wait_receive'},
        {text: '已收运', value: 'received'},
        {text: '已接收', value: 'taken'},
        {text: '已处置', value: 'disposed_of'},
        {text: '收运异常', value: 'abnormal'},
        {text: '已作废', value: 'invalid'},
      ]
    };
  },
  emits: ["done"],
  methods: {
    async open(data = {}, typeList) {
      this.typeList = typeList;
      this.form = {...data};
      this.$refs.dialog.open()
    },
    submit() {
      this.$refs.dialog.close()
      this.$emit("done", {...this.form})
    }
  }
}
</script>

<style lang="scss">
.chongzhi{
	width: 200rpx;
	height: 90rpx;
	border: 1px solid #b3b3b3;
	border-radius: 10rpx;
	font-size: 30rpx;
	color: #999999;
}
.chaxun{
	width: 490rpx;
	height: 90rpx;
	opacity: 1;
	background: #1763fc;
	border-radius: 10rpx;
	font-size: 30rpx;
	color: #fff;
}
</style>
